package com.cnpc.framework.base.entity;

import javax.persistence.*;

import com.cnpc.framework.annotation.ForeignShow;
import com.cnpc.framework.annotation.Header;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "tbl_role")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" })
public class Role  implements Serializable {

    @Id
    @GenericGenerator(name = "id", strategy = "uuid")
    @GeneratedValue(generator = "id")
    @Column(name = "id", length = 36)
    protected String id;


    /**
     * 版本号
     */
    @Version
    @Column(name = "version")
    protected Integer version;

    /**
     * 创建时间
     */
    @Column(name = "create_date_time")
    protected String createDateTime;

    /**
     * 最后修改时间
     */
    @Column(name = "update_date_time")
    protected String updateDateTime;

    /**
     * 删除标记(0启用，1禁用)
     */
    @Column(name = "deleted")
    private Integer deleted;

    @ForeignShow
    @Header(name = "名称")
    @Column(name = "name", length = 50)
    private String name;

    @Header(name = "编码")
    @Column(name = "code", length = 50)
    private String code;

    @Header(name = "备注")
    @Column(name = "remark", length = 1000)
    private String remark;

    @Header(name = "排序")
    @Column(name = "sort")
    private Integer sort;


    @Header(name = "权限部门id")
    @Column(name = "deptId")
    private String deptId;

    @Header(name = "权限")
    @Column(name = "dataScope")
    private int dataScope;

    @Header(name = "合同权限部门id")
    @Column(name = "contractDeptId")
    private String contractDeptId;

    @Header(name = "合同权限")
    @Column(name = "contractDataScope")
    private int contractDataScope;


    public String getName() {

        return name;
    }

    public void setName(String name) {

        this.name = name;
    }

    public String getCode() {

        return code;
    }

    public void setCode(String code) {

        this.code = code;
    }

    public String getRemark() {

        return remark;
    }

    public void setRemark(String remark) {

        this.remark = remark;
    }

    public Integer getSort() {

        return sort;
    }

    public void setSort(Integer sort) {

        this.sort = sort;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
    }

    public String getUpdateDateTime() {
        return updateDateTime;
    }

    public void setUpdateDateTime(String updateDateTime) {
        this.updateDateTime = updateDateTime;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public int getDataScope() {
        return dataScope;
    }

    public void setDataScope(int dataScope) {
        this.dataScope = dataScope;
    }

    public String getContractDeptId() {
        return contractDeptId;
    }

    public void setContractDeptId(String contractDeptId) {
        this.contractDeptId = contractDeptId;
    }

    public int getContractDataScope() {
        return contractDataScope;
    }

    public void setContractDataScope(int contractDataScope) {
        this.contractDataScope = contractDataScope;
    }
}
